import React from 'react'
import { Button, Form, Input, Modal } from 'antd';
import { useEffect } from "react";


type FieldType = {
  id?: string;
  shopName?: string;
  shopAddress?: string;
  shopImage?: string;
  shopTel?: string;
};
function Edit(props: any) {
  // useEffect(() => {
  //   props.onForm(form)
  // })
  return (
    <div>
      <Modal
        title={props.isadd === true ? props.addtitle : props.edittitle}
        open={props.isModalOpen1}
        onOk={props.handleOk1}
        onCancel={props.handleCancel1}
      >
        <Form
          form={props.form}
          name="basic"
          labelCol={{ span: 8 }}
          wrapperCol={{ span: 16 }}
          style={{ maxWidth: 600 }}
          onFinish={props.edit}
          autoComplete="off"
        >
          <Form.Item<FieldType> label="id" name="id">
            <Input />
          </Form.Item>
          <Form.Item<FieldType> label="修改姓名" name="shopName">
            <Input />
          </Form.Item>
          <Form.Item<FieldType> label="修改地址" name="shopAddress">
            <Input />
          </Form.Item>
          <Form.Item<FieldType> label="修改图像" name="shopImage">
            <Input />
          </Form.Item>
          <Form.Item<FieldType> label="修改手机号" name="shopTel">
            <Input />
          </Form.Item>
          <Form.Item label={null}>
            <Button type="primary" htmlType="submit">
              修改
            </Button>
          </Form.Item>
        </Form>
      </Modal>
    </div>
  )
}

export default Edit
